<%@ page import="java.sql.*" %>
<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<html>
  <head>
    
    <title>客户查询</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
<body bgcolor="lightgreen">
    <table align="center" width="500">
        <tr>
            <td>客户查询</td>
            <td>
                <a href="../clientManage/addClient.jsp">客户添加</a>
            </td>
            <td>
                <a href="../clientManage/updateClient.jsp">客户修改</a>
            </td>
            <td>
                <a href="../clientManage/deleteClient.jsp">客户删除</a>
            </td>
        </tr>
    </table>
    <br>
    <hr>
    <br>
    <table align="center" width="700" border="2">
        <tr>
            <th colspan="4">查看客户信息</th>
        </tr>
        <tr>
            <td align="center">姓名</td>
            <td align="center">电话</td>
            <td align="center">地址</td>
            <td align="center">邮箱</td>
        </tr>
        <% 
            Connection con=null;
            Statement st=null;
            ResultSet rs=null;
            Class.forName("com.mysql.jdbc.Driver");
            String url="jdbc:mysql://localhost:3306/eims?useUnicode=true&characterEncoding=gbk";
            con=DriverManager.getConnection(url,"root","123456");
            st=con.createStatement();
            String sql="select * from client";
            rs=st.executeQuery(sql);
            while(rs.next()){
        %>
        <tr>
            <td><%=rs.getString("clientName") %></td>
            <td><%=rs.getString("clientTelephone") %></td>
            <td><%=rs.getString("clientAddress") %></td>
            <td><%=rs.getString("clientEmail") %></td>
        </tr>
        <% 
            }
        %>
    </table>
</body>
</html>